package com.gun.servletComponent;

/**
 * @Authar: 吾图南
 * @Data: 2022/12/10 10:50
 * @Package: com.gun.servletComponent
 * @ClassName: MyFilter
 * @Description: TODO 自定义Filter类
 */

import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
@WebFilter(value = {"/antionLogin","/antionMyFilter"})
//@Component
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException, ServletException {

        System.out.println("hello MyFilter");
        filterChain.doFilter(servletRequest,servletResponse);
    }


    @Override
    public void destroy() {

        System.out.println("销毁先执行了 filter 的方法.....");
    }
}